package com.gopay.bis.dao.genmainorder.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.bis.dao.genmainorder.CpsGenMainOrderDAO;
import com.gopay.bis.dao.genreceiptorder.CpsGeneralReceiptOrderDAO;
import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.domain.cps.CpsGenMainOrder;
import com.gopay.common.domain.cps.CpsGenReceiptOrder;

/**
 * 
 * @author ShenJun
 *
 */
@Repository(value = "cpsGenMainOrderDAO")
public class CpsGenMainOrderDAOImpl extends BaseDAOImpl<CpsGenMainOrder, String> implements CpsGenMainOrderDAO{

	
	public CpsGenMainOrder getCpsGenMainOrderByOrderId(String gopayOrderId) {
		String hql = "from CpsGenMainOrder where gopayOrderId = :gopayOrderId";

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("gopayOrderId", gopayOrderId);

        List<CpsGenMainOrder> list = this.findByHql(hql, params);
        if (list != null && list.size() > 0) {
            return list.get(0);
        }

        return new CpsGenMainOrder();
	}


    


}
